package com.weijianhuawen.wjblog.admin.mode.vo.article;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @version: java version 8
 * @Author: weijianhuawen
 * @description:
 * @date: 2024-10-26 18:27
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value = "更新文章 VO")
public class UpdateArticleReqVo {
    // 文章id
    @NotNull(message = "所选文章不能为空")
    private Long id;
    // 分类id
    @NotNull(message = "文章所属分类不能为空")
    private Long categoryId;

    // 文章内容
    @NotBlank(message = "文章内容不能为空")
    private String content;
    // 文章标题
    @NotBlank(message = "文章标题不能为空")
    @Length(min = 1, max = 52, message = "文章标题字数需大于 1 小于 52")
    private String title;
    // 文章摘要
    @NotBlank(message = "文章摘要不能为空")
    private String summary;
    // 文章封面
    @NotBlank(message = "文章封面不能为空")
    private String cover;

    // 文章标签
    @NotEmpty(message = "文章关联标签不能为空")
    private List<String> tags;
}
